package cn.bonoon.kernel.web;

import javax.servlet.ServletContext;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.BeansException;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
import org.springframework.context.EmbeddedValueResolverAware;
import org.springframework.util.StringValueResolver;
import org.springframework.web.context.ServletContextAware;

/**
 * 提供全局的系统平台的系统状态的监控；
 * 如：是否指定了系统维护关闭的时间等
 * 
 * @author jackson
 *
 */
public final class WorkPlatform implements ServletContextAware, InitializingBean, ApplicationContextAware, EmbeddedValueResolverAware {

	private final Logger log = LoggerFactory.getLogger(this.getClass());

	private ApplicationContext applicationContext;
	
	private StringValueResolver resolver;

	private ServletContext servletContext;
	
//	/** 系统的启动时间 */
//	private long start;

	
    @Override
    public void setEmbeddedValueResolver(StringValueResolver resolver) {
        this.resolver = resolver;
    }
    
	@Override
	public final void setApplicationContext(ApplicationContext context) throws BeansException {
		applicationContext = context;
	}
	
	@Override
	public void setServletContext(ServletContext sc) {
		this.servletContext = sc;
	}
	

	@Override
	public void afterPropertiesSet() throws Exception {

	}
}
